package com.zjeav.lingjiao.base.baseBean;

import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;

import org.xutils.DbManager;
import org.xutils.x;

public class BaseApplication extends MultiDexApplication {

    //创建数据库
    public static DbManager dbManager;
    private static Context mContext;//上下文
    public static DeviceInfo deviceInfo;
    @Override
    public void onCreate() {
        super.onCreate();
        mContext = getApplicationContext();
        deviceInfo=DeviceInfo.getInstance(mContext);

        x.Ext.init(this);
        x.Ext.setDebug(false);//输出debug日志，开启会影响性能，开发时开启
        DbManager.DaoConfig config = new DbManager.DaoConfig().setDbName("eFileDB")
                .setAllowTransaction(true).setDbVersion(2);
        dbManager = x.getDb(config);
    }


    public static Context getContext(){
        return mContext;
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(base);
    }

}
